import React, { Component } from 'react'
import { Route, Switch, Redirect } from 'react-router-dom'
import './App.css'
import Search from './component/Search'
import AntdMenu from './component/AntdMenu'
import About from './pages/About'
import Home from './pages/Home'

export default class App extends Component {

  render() {
    return (
      <div>
        <Search/>
        <div className='app-grout'>
          <AntdMenu/>
          <div>
            {/* 注册路由 Switch匹配到路由就不再往下匹配了，如果不加Switch，会往下匹配，然后有几个显示几个*/}
            <Switch>
               <Route path='/about' component={About} />
               <Route path='/home' component={Home} />
               <Redirect to='/about'></Redirect>
            </Switch>
          </div>
        </div>
      </div>
    )
  }
}
